package com.dmxtechnologies.community.ejb.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class Base64Util {
	//base64 encode编码
	public static String setBase64String(String cookieModelString) {
		try {
			return URLEncoder.encode(cookieModelString,"UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return null;
	}
	//base64 decode
	public static String getBase64String(String value){
		try {
			return URLDecoder.decode(value,"UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} 
		return null;
	}
}
